<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>生产日排产（弃用）</title>
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet" />
<link href="${pageContext.request.contextPath }/css/bootstrap-editable.css" rel="stylesheet" />
<link rel="stylesheet" href="${pageContext.request.contextPath }/bootstrap/dist/css/bootstrap.css">
<link href="${pageContext.request.contextPath }/bootstrap-table/dist/bootstrap-table.min.css" rel="stylesheet" />
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.10.2.js"></script>
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath }/bootstrap-table/dist/bootstrap-table.js"></script>
<script src="${pageContext.request.contextPath }/bootstrap-table/src/locale/bootstrap-table-zh-CN.js"></script>
<%-- <script src="${pageContext.request.contextPath }/bootstrap-table/dist/extensions/editable/bootstrap-table-editable.js"></script>
<script src="${pageContext.request.contextPath }/js/bootstrap-editable.js"></script> --%>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/bootstrap-select/dist/js/i18n/defaults-zh_CN.min.js"></script>
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/bootstrap-select/dist/css/bootstrap-select.min.css">
<script type="text/javascript">
$(function () {
	
	$('#tb_departments2').hide();
	
    //1.初始化Table
    var oTable = new TableInit();
    oTable.Init();

    //2.初始化Button的点击事件
    var oButtonInit = new ButtonInit();
    oButtonInit.Init();
    
    //查找带回，显示带回数据列表
    $("#submitBtn").click(function(){
    	$('#tb_departments2').show();
    });
});


var TableInit = function () {
    var oTableInit = new Object();
    //初始化Table
    oTableInit.Init = function () {
    	 $('#tb_departments1').bootstrapTable({
             url: '${pageContext.request.contextPath }/demo.do',         //请求后台的URL（*）
             method: 'get',                      //请求方式（*）
             toolbar: '#toolbar',                //工具按钮用哪个容器
             striped: true,                      //是否显示行间隔色
             cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
             sortable: false,                     //是否启用排序
             sortOrder: "asc",                   //排序方式
             queryParams: oTableInit.queryParams,//传递参数（*）
             sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
             strictSearch: true,
             clickToSelect: true,                //是否启用点击选中行
             height: 300,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
             uniqueId: "ID",                     //每一行的唯一标识，一般为主键列
             detailView: false,                   //是否显示父子表
             columns: [{
                 checkbox: true
             },{
                 field: 'address',
                 title: '车种'
             },{
             	field: 'address1',
                 title: '品编'
             },{
             	field: 'address2',
                 title: '品名'
             },{
             	field: 'address3',
                 title: '周期'
             },{
             	field: 'address3',
                 title: '计划量'
             },{
             	field: 'address3',
                 title: '实际数量'
             },{
             	field: 'address3',
                 title: '开始时间'
             },{
             	field: 'address3',
                 title: '结束时间'
             },{
             	field: 'address3',
                 title: '状态'
             },{
             	field: 'address3',
                 title: '审批状态'
             },{
             	field: 'address3',
                 title: '作业关闭'
             } ]
         });
    	 
    	 $('#tb_departments2').bootstrapTable({
             url: '${pageContext.request.contextPath }/demo.do',         //请求后台的URL（*）
             method: 'get',                      //请求方式（*）
             toolbar: '#toolbar',                //工具按钮用哪个容器
             striped: true,                      //是否显示行间隔色
             cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
             sortable: false,                     //是否启用排序
             sortOrder: "asc",                   //排序方式
             queryParams: oTableInit.queryParams,//传递参数（*）
             sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
             strictSearch: true,
             clickToSelect: true,                //是否启用点击选中行
             height: 300,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
             uniqueId: "ID",                     //每一行的唯一标识，一般为主键列
             detailView: false,                   //是否显示父子表
             columns: [{
                 checkbox: true
             },{
                 field: 'address',
                 title: '车种'
             },{
             	field: 'address1',
                 title: '品编'
             },{
             	field: 'address2',
                 title: '品名'
             },{
             	field: 'address3',
                 title: '周期'
             },{
             	field: 'address3',
                 title: '计划量'
             },{
             	field: 'address3',
                 title: '实际数量'
             },{
             	field: 'address3',
                 title: '开始时间'
             },{
             	field: 'address3',
                 title: '结束时间'
             },{
             	field: 'address3',
                 title: '状态'
             },{
             	field: 'address3',
                 title: '审批状态'
             },{
             	field: 'address3',
                 title: '作业关闭'
             } ]
         });
    };
    
    //得到查询的参数
    oTableInit.queryParams = function (params) {
        var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
            limit: params.limit,   //页面大小
            offset: params.offset,  //页码
            departmentname: $("#txt_search_departmentname").val(),
            statu: $("#txt_search_statu").val()
        };
        return temp;
    };
    return oTableInit;
};


var ButtonInit = function () {
    var oInit = new Object();
    var postdata = {};

    oInit.Init = function () {
        //初始化页面上面的按钮事件
    };

    return oInit;
};

function doUpdate() {
	var a= $('#tb_departments').bootstrapTable('getSelections');  
	 alert(a[0].id);
}

//下拉框change事件
function fun1() {
	/* $('#tb_departments1').show(); */
	$("#myModal").modal("show");  
}

</script>
<style type="text/css">
</style>
</head>
<body>
	<div class="panel-body" style="padding-bottom:0px;">
        <div class="panel panel-default">
            <div class="panel-heading">查询条件</div>
            <div class="panel-body">
                <form id="formSearch" class="form-horizontal">
                     <div class="form-group">
                     <label for="loginname" class="control-label col-sm-1">日期:</label>
                     <div class="col-sm-3">
                     		<input type="text" class="form-control" id="txt_search_departmentname">
					    </div>
                        <label class="control-label col-sm-1" for="txt_search_departmentname">产线:</label>
                        <div class="col-sm-2">
                            <select class="form-control">
	                         <option>注塑一车间</option>
	                         <option>注塑二车间</option>
	                         <option>注塑三车间</option>
                         </select>
                        </div>
                        <div class="col-sm-1" style="text-align:left;">
                            <button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary">查询</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>      
        
        
        <table class="table table-bordered">
        	<thead>
        		<tr>
        			<th>注塑机吨位</th>
        			<th>注塑机编号</th>
        			<th>班次</th>
        			<th>排产单号</th>
        			<th>计划单号</th>
        			<th>操作</th>
        		</tr>
        	</thead>
		  <tbody align="center">
		    <tr id="d1">
		      <td>130</td>
		      <td>1号机</td>
		      <td>
		      	<select class="selectpicker show-tick form-control">
		      		<option>白班</option>
		      		<option>晚班</option>
		      	</select>
		      </td>
		      <td>pc2017121201</td>
		      <td>
		      	<select onchange="fun1()" class="selectpicker show-tick form-control">
		      		<option>20171212001</option>
		      		<option>20171212002</option>
		      		<option>20171212003</option>
		      		<option>20171212005</option>
		      		<option>20171212006</option>
		      	</select>
		      </td>
		      <td><a href="#">提交审批</a></td>
		    </tr>
		    <tr id="d2">
		      <td>190</td>
		      <td>2号机</td>
		      <td>
		      	<select class="selectpicker show-tick form-control"> 
		      		<option>白班</option>
		      		<option>晚班</option>
		      	</select>
		      </td>
		      <td>pc2017121202</td>
		      <td>
		      	<select onchange="fun1()" class="selectpicker show-tick form-control">
		      		<option>20171212001</option>
		      		<option>20171212002</option>
		      		<option>20171212003</option>
		      		<option>20171212005</option>
		      		<option>20171212006</option>
		      	</select>
		      </td>
		      <td><a href="#">提交审批</a></td>
		    </tr>
		    <tr id="d3">
		      <td>260</td>
		      <td>3号机</td>
		      <td>
		      	<select class="selectpicker show-tick form-control">
		      		<option>白班</option>
		      		<option>晚班</option>
		      	</select>
		      </td>
		      <td>pc2017121203</td>
		      <td>
		      	<select onchange="fun1()" class="selectpicker show-tick form-control">
		      		<option>20171212001</option>
		      		<option>20171212002</option>
		      		<option>20171212003</option>
		      		<option>20171212005</option>
		      		<option>20171212006</option>
		      	</select>
		      </td>
		      <td><a href="#">提交审批</a></td>
		    </tr>
		    <tr id="d4">
		      <td>380</td>
		      <td>4号机</td>
		      <td>
		      	<select class="selectpicker show-tick form-control">
		      		<option>白班</option>
		      		<option>晚班</option>
		      	</select>
		      </td>
		      <td>pc2017121204</td>
		      <td>
		      	<select class="selectpicker show-tick form-control" onchange="fun1()">
		      		<option >20171212001</option>
		      		<option>20171212002</option>
		      		<option>20171212003</option>
		      		<option>20171212005</option>
		      		<option>20171212006</option>
		      	</select>
		      	<td><a href="#">提交审批</a></td>
		    </tr>
		   </tbody>
		</table>
        <table id="tb_departments2"></table>
    </div>
    
    <div class="modal fade " id="myModal" role="dialog" aria-labelledby="myModal">
	    <div class="modal-dialog" role="document" style="padding-left: 0px;padding-right: 0px;margin-right: 100x;margin-left: 200px;left: 00px;width: 70%;height:900; clear: both;">
	        <div class="modal-content">
	
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
	                        aria-hidden="true">&times;</span></button>
	                <h4 class="modal-title" id="exampleModalLabel">选择计划单详情</h4>
	            </div>
	
	            <div class="modal-body">
	               <form id="updateform">
	                	<table class="table table-bordered">
	                		<tr>
	                			<td></td>
	                			<td>车种</td>
	                			<td>品编</td>
	                			<td>品名</td>
	                			<td>周期</td>
	                			<td>计划量</td>
	                			<td>实际数量</td>
	                			<td>开始时间</td>
	                			<td>结束时间</td>
	                			<td>状态</td>
	                			<td>审批状态</td>
	                			<td>作业关闭</td>
	                		</tr>
	                		<tr>
	                			<td><input type="checkbox"></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                		</tr>
	                		<tr>
	                			<td><input type="checkbox"></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                		</tr>
	                		<tr>
	                			<td><input type="checkbox"></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                		</tr>
	                		<tr>
	                			<td><input type="checkbox"></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                			<td></td>
	                		</tr>
	                	</table>
	                	 <div class="text-right">
					        <span id="returnMessage" class="glyphicon"> </span>
					        <button type="button" class="btn btn-default right" data-dismiss="modal">取消</button>
					        <button id="submitBtn" type="button" class="btn btn-primary" data-dismiss="modal">提交</button>
					    </div>
	                </form>
	            </div>
	        </div>
	    </div>
	</div>
</body>
</html>